package org.homly.admin.action.product;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.homly.service.ProductService;

public class SetConfigBottomAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		Integer configId = null;

		String configIdS = request.getParameter("id");
		if (configIdS == null || "".equals(configIdS)) {
			configIdS = "0";
		}
		configId = Integer.valueOf(configIdS);

		ProductService productService = new ProductService();
		if (configId != null && configId.intValue() != 0) {
			productService.setConfigBottom(configId);
		}

		return new ActionForward(mapping.findForward("manager_config").getPath(), true);
	}

}
